
<form name="editForm" role="form" novalidate ng-submit="vm.save()" >

    <div class="modal-header">
        <button type="button" class="close" data-dismiss="modal" aria-hidden="true"
                ng-click="vm.clear()">&times;</button>
        <h4 class="modal-title" id="myProductLabel" data-translate="byibserverApp.product.home.createOrEditLabel">Create or edit a Product</h4>
    </div>
    <div class="modal-body">
        <jhi-alert-error></jhi-alert-error>
        <div class="form-group" ng-show="vm.product.id">
            <label for="id" data-translate="global.field.id">ID</label>
            <input type="text" class="form-control" id="id" name="id"
                    ng-model="vm.product.id" readonly />
        </div>
        <div class="form-group">
            <label class="control-label" data-translate="byibserverApp.product.productName" for="field_productName">Product Name</label>
            <input type="text" class="form-control" name="productName" id="field_productName"
                    ng-model="vm.product.productName"
                    />
        </div>
        <div class="form-group">
            <label class="control-label" data-translate="byibserverApp.product.productImg" for="field_productImg">Product Img</label>

          <div>
              <button class="btn btn-primary hide-input">
                  选择图片
                  <input type="file"  name="productImg" id="field_productImg" select-img="vm.product.productImg" loading="vm.product.imgLoading" loading-success="vm.product.imgLoadSuceess" accept="image/jpeg,image/png,image/jpg" />
              </button>
              <div class="img-placeholder">
                  <img ng-src="{{vm.product.productImg}}" alt="">
                  <span  ng-show="vm.product.imgLoadSuceess" style="color: #FE7F7F;margin-left: 10px">上传成功！</span>
              </div>
              <div class="loading-img" ng-show="vm.product.imgLoading"><img src="content/images/loading.gif" alt="">图片上传中...</div>
          </div>
        </div>
        <div class="form-group">
            <label class="control-label" data-translate="byibserverApp.product.overallScore" for="field_overallScore">Overall Score</label>
            <input type="text" class="form-control" name="overallScore" id="field_overallScore"
                    ng-model="vm.product.overallScore"
                    />
        </div>
        <div class="form-group">
            <label class="control-label" data-translate="byibserverApp.product.amountOfIndemnificationSocre" for="field_amountOfIndemnificationSocre">Amount Of Indemnification Socre</label>
            <input type="text" class="form-control" name="amountOfIndemnificationSocre" id="field_amountOfIndemnificationSocre"
                    ng-model="vm.product.amountOfIndemnificationSocre"
                    />
        </div>
        <div class="form-group">
            <label class="control-label" data-translate="byibserverApp.product.ensureScopeSocre" for="field_ensureScopeSocre">Ensure Scope Socre</label>
            <input type="text" class="form-control" name="ensureScopeSocre" id="field_ensureScopeSocre"
                    ng-model="vm.product.ensureScopeSocre"
                    />
        </div>
        <div class="form-group">
            <label class="control-label" data-translate="byibserverApp.product.claimsSettlementSocre" for="field_claimsSettlementSocre">Claims Settlement Socre</label>
            <input type="text" class="form-control" name="claimsSettlementSocre" id="field_claimsSettlementSocre"
                    ng-model="vm.product.claimsSettlementSocre"
                    />
        </div>
        <div class="form-group">
            <label class="control-label" data-translate="byibserverApp.product.convenientServicetSocre" for="field_convenientServicetSocre">Convenient Servicet Socre</label>
            <input type="text" class="form-control" name="convenientServicetSocre" id="field_convenientServicetSocre"
                    ng-model="vm.product.convenientServicetSocre"
                    />
        </div>
        <div class="form-group">
            <label class="control-label" data-translate="byibserverApp.product.strichenClaimTimes" for="field_strichenClaimTimes">Strichen Claim Times</label>
            <input type="text" class="form-control" name="strichenClaimTimes" id="field_strichenClaimTimes"
                    ng-model="vm.product.strichenClaimTimes"
                    />
        </div>
        <div class="form-group">
            <label class="control-label" data-translate="byibserverApp.product.mildClaimTimes" for="field_mildClaimTimes">Mild Claim Times</label>
            <input type="text" class="form-control" name="mildClaimTimes" id="field_mildClaimTimes"
                    ng-model="vm.product.mildClaimTimes"
                    />
        </div>
        <div class="form-group">
            <label class="control-label" data-translate="byibserverApp.product.strichenNum" for="field_strichenNum">Strichen Num</label>
            <input type="text" class="form-control" name="strichenNum" id="field_strichenNum"
                    ng-model="vm.product.strichenNum"
                    />
        </div>
        <div class="form-group">
            <label class="control-label" data-translate="byibserverApp.product.mildNum" for="field_mildNum">Mild Num</label>
            <input type="text" class="form-control" name="mildNum" id="field_mildNum"
                    ng-model="vm.product.mildNum"
                    />
        </div>
        <div class="form-group">
            <label class="control-label" data-translate="byibserverApp.product.stricheProbability" for="field_stricheProbability">Striche Probability</label>
            <input type="text" class="form-control" name="stricheProbability" id="field_stricheProbability"
                    ng-model="vm.product.stricheProbability"
                    />
        </div>
        <div class="form-group">
            <label class="control-label" data-translate="byibserverApp.product.mildProbability" for="field_mildProbability">Mild Probability</label>
            <input type="text" class="form-control" name="mildProbability" id="field_mildProbability"
                    ng-model="vm.product.mildProbability"
                    />
        </div>
        <div class="form-group">
            <label class="control-label" data-translate="byibserverApp.product.dcRate" for="field_dcRate">Dc Rate</label>
            <input type="text" class="form-control" name="dcRate" id="field_dcRate"
                    ng-model="vm.product.dcRate"
                    />
        </div>
        <div class="form-group">
            <label class="control-label" data-translate="byibserverApp.product.expertOverallScore" for="field_expertOverallScore">Expert Overall Score</label>
            <input type="text" class="form-control" name="expertOverallScore" id="field_expertOverallScore"
                    ng-model="vm.product.expertOverallScore"
                    />
        </div>
        <div class="form-group">
            <label class="control-label" data-translate="byibserverApp.product.purchaseLink" for="field_purchaseLink">Purchase Link</label>

            <div>

                <div class="btn btn-primary hide-input">
                    上传原文合同
                    <input type="file"  name="productImg" nv-file-select uploader="uploader"/>
                </div>
                <br/>
                <br/>
                <div ng-repeat="item in uploader.queue">
                    <div style="margin-bottom: 5px">
                        文件名：
                        <strong style="font-size: 18px">{{item.file.name}}</strong> &nbsp;&nbsp;&nbsp;
                        <span ng-show="item.isSuccess"style="color:#3EC6AB">恭喜！！上传成功！！！</span>
                        <span ng-show="item.isError" style="color:#AA0000">额....上传失败...</span>
                    </div>
                    <div class="btn btn-default hide-input" ng-click="item.upload()">上传</div>
                </div>

            </div>
        </div>

        <div class="form-group">
            <label data-translate="byibserverApp.product.insurer" for="field_insurer">Insurer</label>
            <select class="form-control" id="field_insurer" name="insurer" ng-model="vm.product.insurerId" ng-options="isurer.id as isurer.corporateName for isurer in vm.isurers"            >
                <option value=""></option>
            </select>
        </div>
        <div class="form-group">
            <label data-translate="byibserverApp.product.typesOfInsurance" for="field_typesOfInsurance">Types Of Insurance</label>
            <select class="form-control" id="field_typesOfInsurance" name="typesOfInsurance" ng-model="vm.product.typesOfInsuranceId" ng-options="typesOfInsurance.id as typesOfInsurance.typesOfInsuranceName for typesOfInsurance in vm.typesofinsurances"            >
                <option value=""></option>
            </select>
        </div>
        <div class="form-group">
            <label data-translate="byibserverApp.product.wordKey" for="field_wordKey">Word Key</label>
            <select class="form-control" id="field_wordKey" multiple name="wordKey" ng-model="vm.product.wordKeys" ng-options="wordKey as wordKey.keyName for wordKey in vm.wordkeys track by wordKey.id"></select>
        </div>
    </div>
    <div class="modal-footer">
        <button type="button" class="btn btn-default" data-dismiss="modal" ng-click="vm.clear()">
            <span class="glyphicon glyphicon-ban-circle"></span>&nbsp;<span data-translate="entity.action.cancel">Cancel</span>
        </button>
        <button type="submit" ng-disabled="editForm.$invalid || vm.isSaving" class="btn btn-primary">
            <span class="glyphicon glyphicon-save"></span>&nbsp;<span data-translate="entity.action.save">Save</span>
        </button>
    </div>
</form>
